package com.dkm.entity;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.OneToOne;
import javax.persistence.Table;

import org.springframework.format.annotation.DateTimeFormat;
@Entity
@Table(name = "counselor")
public class Counselor {

	@Id
	private String counselor_id;
	private String counselor_name;
	private Integer sign_in_state;
	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	private Date sign_in_time;
	private String is_allot;
	private String remark;
	private Integer weight;
	
	@Column(name = "role_name")
	private String roleName;
	
	//咨询师和用户一对一关系
	@OneToOne(fetch = FetchType.EAGER)
	@JoinColumn(name = "user_id")
	private Users user;
	
	public String getRoleName() {
		return roleName;
	}
	public void setRoleName(String roleName) {
		this.roleName = roleName;
	}
	public Users getUser() {
		return user;
	}
	public void setUser(Users user) {
		this.user = user;
	}
	public Counselor() {
		super();
		// TODO Auto-generated constructor stub
	}
	public Counselor(String counselor_id, String counselor_name, Integer sign_in_state, Date sign_in_time,
			String is_allot, String remark, Integer weight) {
		super();
		this.counselor_id = counselor_id;
		this.counselor_name = counselor_name;
		this.sign_in_state = sign_in_state;
		this.sign_in_time = sign_in_time;
		this.is_allot = is_allot;
		this.remark = remark;
		this.weight = weight;
	}
	public String getCounselor_id() {
		return counselor_id;
	}
	public void setCounselor_id(String counselor_id) {
		this.counselor_id = counselor_id;
	}
	public String getCounselor_name() {
		return counselor_name;
	}
	public void setCounselor_name(String counselor_name) {
		this.counselor_name = counselor_name;
	}
	public Integer getSign_in_state() {
		return sign_in_state;
	}
	public void setSign_in_state(Integer sign_in_state) {
		this.sign_in_state = sign_in_state;
	}
	public Date getSign_in_time() {
		return sign_in_time;
	}
	public void setSign_in_time(Date sign_in_time) {
		this.sign_in_time = sign_in_time;
	}
	public String getIs_allot() {
		return is_allot;
	}
	public void setIs_allot(String is_allot) {
		this.is_allot = is_allot;
	}
	public String getRemark() {
		return remark;
	}
	public void setRemark(String remark) {
		this.remark = remark;
	}
	public Integer getWeight() {
		return weight;
	}
	public void setWeight(Integer weight) {
		this.weight = weight;
	}
	@Override
	public String toString() {
		return "Counselor [counselor_id=" + counselor_id + ", counselor_name=" + counselor_name + ", sign_in_state="
				+ sign_in_state + ", sign_in_time=" + sign_in_time + ", is_allot=" + is_allot + ", remark=" + remark
				+ ", weight=" + weight + "]";
	}
}
